// const fetch = require("node-fetch")
/**
 * 
 * @param {*} ip 
 */
let axios = require("axios")
/**
 * @returns {Promise<{country:string,city:string,region:string}>}
 */
async function getIp(ip) {
	return	axios.default.get("http://ip.taobao.com/service/getIpInfo.php", {
		params: {
			rand:Math.random(),
			ip
		}
	}).then(v => v.data&&v.data.data).then(console.log)
}
// getIp("116.22.132.162")
module.exports = {getIp}